package com.tianquan.test.aop;/**
 * @author starsea
 * @date 2024-10-08 上午10:29
 */

import com.tianquan.miracle.annotation.Component;
import com.tianquan.miracle.aop.*;
import com.tianquan.miracle.aop.annotation.*;

/**
 *@BelongsProject: uploaddemo
 *@BelongsPackage: com.tianquan.miracledemo.test
 *@Author: tianquan
 *@CreateTime: 2024-10-08  10:29
 *@Description: 测试
 *@Version: 1.0
 */
@Aspect
@Component
public class aop {

    @Pointcut(classArray = {OrderServiceImpl.class})
    public void test(){}


    @Before("test()")
    public void before() throws Throwable {
        System.out.println("---before---");
    }

    @Around("test()")
    public void around(JoinPoint joinPint) throws Throwable {
        System.out.println("--- around-before---");
        Object proceed = joinPint.proceed();
        System.out.println("--around-after---");
    }

    @After("test()")
    public void after() throws Throwable {
        System.out.println("--after---");
    }

}
